import { defineStore } from 'pinia'

export const useCounterStore = defineStore('stores', {
  state: () => ({
    token: '',
    iconState: false,
    popUP: false,
    authName: [] as string[],
    addState: false,
  }),
  actions: {
    setToken(i: string) {
      this.token = i
    },
    DelToken() {
      this.token = ''
      localStorage.removeItem('token')
    },
    iconStateFun(i: boolean) {
      this.iconState = i
    },

    popUPFun(i: boolean) {
      this.popUP = i
    },
    authNameFun(i: string[]) {
      this.authName = i
    },
  },
  //开启持久化
  persist: true,
})
